<?php if(!defined('IN_DISCUZ')) exit('Access Denied'); hookscriptoutput('discuz');?>
<?php if($_G['setting']['mobile']['mobilehotthread'] && $_GET['forumlist'] != 1) { dheader('Location:forum.php?mod=guide&view=hot&mobile=2');exit;?><?php } include template('common/header'); ?><script type="text/javascript">
function getvisitclienthref() {
var visitclienthref = '';
if(ios) {
visitclienthref = 'https://itunes.apple.com/cn/app/zhang-shang-lun-tan/id489399408?mt=8';
} else if(andriod) {
visitclienthref = 'http://www.discuz.net/mobile.php?platform=android';
}
return visitclienthref;
}
</script>

<?php if($_GET['visitclient']) { ?>

<header class="header">
    <div class="nav">
<span>温馨提示</span>
    </div>
</header>
<div class="cl">
<div class="clew_con">
<h2 class="tit">掌上论坛手机客户端</h2>
<p>随时随地上论坛<input class="redirect button" id="visitclientid" type="button" value="点击下载" href="" /></p>
<h2 class="tit">iPhone,Andriod等智能手机</h2>
<p>直接登录手机版，阅读体验更佳<input class="redirect button" type="button" value="访问手机版" href="<?php echo $_GET['visitclient'];?>" /></p>
</div>
</div>
<script type="text/javascript">
var visitclienthref = getvisitclienthref();
if(visitclienthref) {
$('#visitclientid').attr('href', visitclienthref);
} else {
window.location.href = '<?php echo $_GET['visitclient'];?>';
}
</script>

<?php } else { ?>

<!-- header start -->
<?php if($showvisitclient) { ?>
<div class="visitclienttip vm" style="display:block;">
<a href="javascript:;" id="visitclientid" class="btn_download">立即下载</a>	
<p>
下载新版掌上论坛客户端，尊享多项看帖特权!
</p>
</div>
<script type="text/javascript">
var visitclienthref = getvisitclienthref();
if(visitclienthref) {
$('#visitclientid').attr('href', visitclienthref);
$('.visitclienttip').css('display', 'block');
}
</script>
<?php } ?>

<!-- header start -->
<div class="bz-header">
<div class="bz-header-left">
<a href="javascript:history.back();" class="iconfont icon-fanhui"></a>
</div>
<h2><?php echo $_G['setting']['bbname'];?></h2>
<div class="bz-header-right">
<a href="<?php if($_GET['mod'] == 'forumdisplay' || $_GET['mod'] == 'viewthread') { ?>forum.php?mod=post&action=newthread&fid=<?php echo $_G['fid'];?><?php } else { ?>forum.php?mod=misc&action=nav<?php } ?>" class="iconfont icon-fatie"></a>
</div>
</div>
<div class="banzhuan-top"></div>
<!-- header end -->

<?php if(!empty($_G['setting']['pluginhooks']['index_top_mobile'])) echo $_G['setting']['pluginhooks']['index_top_mobile'];?>

<!-- main forumlist start -->
<div class="banzhuan-h10"></div>
<?php if(empty($gid)) { ?>
<div id="chart" class="cl bz-bg-fff bz-p10">
<ul>
<li>
<span>今日</span>
<em style="color: #F74C31; font-weight: 700;"><?php echo $todayposts;?></em>
</li>
<li>
<span>帖子</span>
<em><?php echo $posts;?></em>
</li>
<li>
<span>会员</span>
<em><?php echo $_G['cache']['userstats']['totalmembers'];?></em>
</li>
</ul>
</div>
<?php } if($_G['uid']) { if(empty($gid) && !empty($forum_favlist)) { ?>
<div>
<div class="subforumshow bm_h cl banzhuan-clear bz-mt10" href="#sub_forum_0">
<span class="o">
<em class="<?php if(!$_G['setting']['mobile']['mobileforumview']) { ?>iconfont icon-kaiguan-kai color-green icon-kaiguan-guan color-b<?php } ?>"></em>
</span>
<h2><a href="javascript:;">我收藏的版块</a></h2>
</div>
<div id="sub_forum_0" class="sub_forum">
<ul><?php $forumscount = count($forum_favlist);?><?php $forumcolumns = $forumscount > 3 ? ($forumscount == 4 ? 4 : 5) : 1;?><?php $forumcolwidth = (floor(100 / $forumcolumns) - 0.1).'%';?><?php $favorderid = 0;?><?php if(is_array($forum_favlist)) foreach($forum_favlist as $key => $favorite) { if($favforumlist[$favorite['id']]) { $forum=$favforumlist[$favorite[id]];?><?php $forumurl = !empty($forum['domain']) && !empty($_G['setting']['domain']['root']['forum']) ? 'http://'.$forum['domain'].'.'.$_G['setting']['domain']['root']['forum'] : 'forum.php?mod=forumdisplay&fid='.$forum['fid'];?><?php if($forumcolumns>1) { ?>
<li>
<div class="name-pic">
<?php if($forum['icon']) { ?>
<?php echo $forum['icon'];?>
<?php } else { ?>
<a href="forum.php?mod=forumdisplay&amp;fid=<?php echo $forum['fid'];?>&amp;filter=lastpost&amp;orderby=lastpost&amp;mobile=2">
<span class="nopic" style="width:100%; height:100%;"></span>
</a>
<?php } ?>
</div>
<div class="name-tit">
<a href="forum.php?mod=forumdisplay&amp;fid=<?php echo $forum['fid'];?>&amp;filter=lastpost&amp;orderby=lastpost&amp;mobile=2">
<?php echo $forum['name'];?>
<p>
<?php if($forum['todayposts'] > 0) { ?>
<span style="color: #F74C31;">今日 <em><?php echo $forum['todayposts'];?></em></span>
<?php } else { ?>
<span>主题 <em><?php echo $forum['threads'];?></em></span>
<?php } ?>
</P>
</a>
</div>
</li><?php $favorderid++;?><?php } else { ?>
<li>
<div class="name-pic">
<?php if($forum['icon']) { ?>
<?php echo $forum['icon'];?>
<?php } else { ?>
<a href="forum.php?mod=forumdisplay&amp;fid=<?php echo $forum['fid'];?>&amp;filter=lastpost&amp;orderby=lastpost&amp;mobile=2">
<span class="nopic" style="width:100%; height:100%;"></span>
</a>
<?php } ?>
</div>
<div class="name-tit">
<a href="forum.php?mod=forumdisplay&amp;fid=<?php echo $forum['fid'];?>&amp;filter=lastpost&amp;orderby=lastpost&amp;mobile=2">
<?php echo $forum['name'];?>
<p>
<?php if($forum['todayposts'] > 0) { ?>
<span style="color: #F74C31;">今日 <em><?php echo $forum['todayposts'];?></em></span>
<?php } else { ?>
<span>主题 <em><?php echo $forum['threads'];?></em></span>
<?php } ?>
</P>
</a>
</div>
</li>
<?php } } } ?>
</ul>
</div>
</div>
<?php } } else { ?>
<div class="subforumshow bm_h cl banzhuan-clear bz-mt10" href="#sub_forum_0">
<span class="o">
<em class="<?php if(!$_G['setting']['mobile']['mobileforumview']) { ?>iconfont icon-kaiguan-kai color-green icon-kaiguan-guan color-b<?php } ?>"></em>
</span>
<h2><a href="javascript:;">我收藏的版块</a></h2>
</div>
<div id="sub_forum_0" style="text-align: center; background: #FFFFFF; padding: 30px 0;">
<a href="<?php if($_G['uid']) { ?>home.php?mod=space&uid=<?php echo $_G['uid'];?>&do=profile&mycenter=1<?php } else { ?>member.php?mod=logging&action=login<?php } ?>" class="color-b" style="font-size: 14px;">
登录view我收藏的版块
</a>
</div>
<?php } ?>

<div class="bz-mtb10" id="wp"><?php if(is_array($catlist)) foreach($catlist as $key => $cat) { ?><div class="bz-mb10 banzhuan-clear">
<div class="subforumshow bm_h cl banzhuan-clear" href="#sub_forum_<?php echo $cat['fid'];?>">
<span class="o">
<em class="<?php if(!$_G['setting']['mobile']['mobileforumview']) { ?>iconfont icon-kaiguan-kai color-green icon-kaiguan-guan color-b<?php } ?>"></em>
</span>
    <h2><a href="javascript:;"><?php echo $cat['name'];?></a></h2>
</div>
<div id="sub_forum_<?php echo $cat['fid'];?>" class="sub_forum">
<ul><?php if(is_array($cat['forums'])) foreach($cat['forums'] as $forumid) { $forum=$forumlist[$forumid];?><?php $forumurl = !empty($forum['domain']) && !empty($_G['setting']['domain']['root']['forum']) ? 'http://'.$forum['domain'].'.'.$_G['setting']['domain']['root']['forum'] : 'forum.php?mod=forumdisplay&fid='.$forum['fid'];?><li>
<div class="name-pic">
                    <?php if($forum['icon']) { ?>
                        <?php echo $forum['icon'];?>
                    <?php } else { ?>
                        <a href="forum.php?mod=forumdisplay&amp;fid=<?php echo $forum['fid'];?>&amp;filter=lastpost&amp;orderby=lastpost&amp;mobile=2">
                            <span class="nopic" style="width:100%; height:100%;"></span>
                        </a>
                    <?php } ?>
    </div>
                    	<div class="name-tit">
                    		<a href="forum.php?mod=forumdisplay&amp;fid=<?php echo $forum['fid'];?>&amp;filter=lastpost&amp;orderby=lastpost&amp;mobile=2">
                    			<?php echo $forum['name'];?>
                    	        <p>
                    	        	<?php if($forum['todayposts'] > 0) { ?>
                    	        	    <span style="color: #F74C31;">今日 <em><?php echo $forum['todayposts'];?></em></span>
                    	        <?php } else { ?>
                    	        	    <span>主题 <em><?php echo $forum['threads'];?></em></span>
                    	        	<?php } ?>
                    	        </P>
                    	    </a>
                    	</div>
</li>
<?php } ?>
</ul>
</div>
</div>
<?php } ?>
</div>
<!-- main forumlist end -->

<?php if(!empty($_G['setting']['pluginhooks']['index_middle_mobile'])) echo $_G['setting']['pluginhooks']['index_middle_mobile'];?>
<script type="text/javascript">
(function() {
<?php if(!$_G['setting']['mobile']['mobileforumview']) { ?>
$('.sub_forum').css('display', 'block');
<?php } else { ?>
$('.sub_forum').css('display', 'none');
<?php } ?>
$('.subforumshow').on('click', function() {
var obj = $(this);
var subobj = $(obj.attr('href'));
if(subobj.css('display') == 'none') {
subobj.css('display', 'block');
obj.find('em').attr('class', 'iconfont icon-kaiguan-kai color-green');
} else {
subobj.css('display', 'none');
obj.find('em').attr('class', 'iconfont icon-kaiguan-guan color-b');
}
});
 })();
</script>
<?php } ?>

<div class="banzhuan-clear"></div><?php include template('common/footer'); ?>